The Doctrine Project (or Doctrine) is a set of PHP libraries primarily focused on providing persistence services and related functionality. Its prize projects are an object-relational mapper (ORM) and the database abstraction layer it is built on top of. One of Doctrine's key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL). ==Usage demonstration== Entities in Doctrine 2 are lightweight PHP Objects that contain persistable properties. A persistable property is an instance variable of the entity that is saved into and retrieved from the database by Doctrine’s data mapping capabilities via the Entity Manager - an implementation of the data mapper pattern:
Doctrine 1.x follows the active record pattern for working with data, where a class corresponds with a database table. For instance, if a programmer wanted to create a new "User" object in a database, he/she would no longer need to write SQL queries, but instead could use the following PHP code: